import request from '../../request/index'
import API from '../../request/api'

Page({
  data: {
    banners: [],
    navList: []
  },
  onLoad: function (options) {
    this.getBannerList()
    this.getNavList()
  },
  getBannerList () {
    const parmas = {
      url: API.bannnerList
    }
    request(parmas).then(res => {
      if (res.code === 200) {
        this.setData({
          banners: res.data
        })
      }
    })
  },
  getNavList () {
    const parmas = {
      url: API.navList
    }
    request(parmas).then(res => {
      if (res.code === 200) {
        this.setData({
          navList: res.data
        })
      }
    })
  }
})
  